package com.donglan.pethome.organization.controller;

import com.donglan.pethome.basic.util.AjaxResult;
import com.donglan.pethome.basic.util.PageList;
import com.donglan.pethome.organization.domain.Department;
import com.donglan.pethome.organization.domain.Shop;
import com.donglan.pethome.organization.query.DepartmentQuery;
import com.donglan.pethome.organization.service.DepartmentService;
import com.donglan.pethome.organization.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: zhangdonghui
 * @Date: 2021/10/25 10:32
 */
@RequestMapping("shop")
@RestController
public class ShopController {

    @Autowired
    private ShopService shopService;

    /*
     * 功能描述 店铺入驻
     * @author zhangdonghui
     * @date 2022/1/11 15:11
     * @param shop
     * @return com.donglan.pethome.basic.util.AjaxResult
     */
    @PutMapping("/settledIn")
    public AjaxResult settledIn(@RequestBody Shop shop){
        try {
            shopService.settledIn(shop);
            return new AjaxResult();
        } catch (Exception e) {
            e.printStackTrace();
            return new AjaxResult(false,e.getMessage());
        }
    }
}
